package com.zzs.elm.service;

import com.zzs.elm.dao.UserDao;
import com.zzs.elm.po.User;
import com.zzs.elm.util.MyJSONUtil;
import com.zzs.elm.util.VerifyUtil;

public class UserService {

	private UserDao userDao = new UserDao();
	
	public boolean getUserByIdByPass(String userId, String pwd) throws Exception {
		return userDao.getUserByIdByPass(userId, pwd);
	}

	public User getUserById(String userId) throws Exception {
		return userDao.getUserById(userId);
	}

	public Object saveUser(User user) throws Exception {
		if (user.getUserId().length() != 11 || !VerifyUtil.verifyPhoneNumber(user.getUserId()))
            throw new Exception();
		return userDao.saveUser(user);
	}

}
